﻿using System.Windows;
using System.Windows.Controls;

namespace ZZMES.Views
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.txt_TcpMsg.TextChanged += Txt_TcpMsg_TextChanged;
        }

        private void Txt_TcpMsg_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
        {
            // 将光标位置设置到文本的末尾
            this.txt_TcpMsg.CaretPosition = this.txt_TcpMsg.Document.ContentEnd;
            // 滚动到光标位置
            this.txt_TcpMsg.ScrollToEnd();
        }
    }
}
